<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>
<script>
import { sampleData } from "api/index.js";
export default {
  name: 'App',
  methods: {
    notLogin() {
      sampleData
        .notLogin()
        .then(res => {
          if (res.code == 0 || res.code == 200) {
          } else if (res.code == 401 && res.msg == "invalid token") {
            this.$router.push("/login");
          } else {
            this.$Message.error(res.msg);
          }
        })
        .catch(error => {
          this.$Message.error(error);
        });
    },
  },
  created() {
    this.notLogin()
  },
}
</script>

<style lang="scss">
// 引入公共变量及方法
@import '~common/scss/base-style.scss';
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  background:#fff;
  height: 100%;
  width: 100%;
}
</style>
<style lang="less">
      @import '~vux/src/styles/reset.less';
</style>
